import java.util.Scanner;

public class Main1176 {
        public static void main(String[] args) {
            Scanner sc=new Scanner(System.in);
            int x=0;
            int y=0;
            do {
                int n=sc.nextInt();
                int[] num=new int[n];
                if (n == 0)
                    break;
                else if (x<0)
                    y++;
                else x++;
            }while (true);

        }
    }
